﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="/View/CSS/bootstrap3.3.5/css/bootstrap.css" />
    <link href="/Web/CSS/main.css" rel="stylesheet" />
    <link href="/Web/CSS/reset.css" rel="stylesheet" />
    <link href="../CSS/regit.css" rel="stylesheet" />
    <script src="../layDate/laydate/laydate.js"></script>
    <script src="../JS/jquery-1.11.2.min.js"></script>
    <script src="../JS/avalon1.47.js"></script>
    <script src="../JS/jquery-migrate-1.1.0.min.js"></script>
    <script src="../JS/jquery.cityselect.js"></script>
    <script src="../../View/CSS/bootstrap3.3.5/js/bootstrap.js"></script>
    <style>
        body {
            font: 12px/1.5 "Microsoft YaHei",SimSun,Tahoma, Helvetica, Arial, sans-serif;
        }

        li {
            list-style: none;
        }

        .listUl {
            list-style: square inside;
        }

            .listUl li {
                margin-top: 10px;
                font-size: 13px;
                font-family: "宋体";
            }

            .listUl .listDate {
                float: right;
            }

        .pageNum {
            width: 30px;
        }

        .pageLink {
            margin-top: 10px;
            text-align: center;
        }

            .pageLink span {
                margin: 0 5px;
            }

        @CHARSET "UTF-8";

        #pages {
            width: 100%;
            clear: both;
            text-align: center;
            font-size: 12px;
            font-family: Verdana, Arial, Helvetica, sans-serif;
            margin-top: 20px;
            margin-bottom: 20px;
            color: #8d8d8d;
        }

            #pages a, #pages span {
                margin-left: 3px;
                margin-right: 3px;
                width: 22px;
                height: 22px;
                line-height: 22px;
                border: 1px solid #e0e0e0;
                color: #aaa;
                display: inline-block;
            }

                #pages a:hover {
                    border: 1px solid #a0a0a0;
                }

            #pages span {
                background: #f0f0f0;
                color: #ffffff;
            }

            #pages span {
                font-weight: bold;
                position: relative;
                top: 0px;
            }

            #pages a.previous {
                width: 25px;
                position: relative;
                top: 0px;
            }

            #pages a.next {
                width: 25px;
                position: relative;
                top: 0px;
            }

        .baocun {
            display: block;
            width: 360px;
            height: 40px;
            background-color: green;
            text-align: center;
            line-height: 40px;
            margin-top: 40px;
            color: white;
            margin-left: 200px;
        }

        .regFieldMsg {
            display: none;
        }
    </style>
    <script>
        var model = avalon.define({
            $id: "zhuce",
            pagecode: "1",//
            nouser: {},
            workls: [],
            gwdata: [],
            nowwork: {},
            bjxsdata: [],
            bjmodel: {},
            changepage: function (code) {
                model.pagecode = code;
                if (code == "2") {
                    $.getJSON("/API/VIEWAPI.ashx?Action=Commanage_GETWORKJL&r=" + Math.random(), { xh: model.nouser.xh }, function (resultData) {
                        if (resultData.ErrorMsg == "") {
                            model.workls = resultData.Result;
                            model.nowwork = resultData.Result1;
                            model.gwdata = resultData.Result2;

                        }
                    });
                }
                if (code == "4") {
                    $.getJSON("/API/VIEWAPI.ashx?Action=Commanage_GETBJXX&r=" + Math.random(), { bj: model.nouser.bj }, function (resultData) {
                        if (resultData.ErrorMsg == "") {
                            model.bjxsdata = resultData.Result;
                            model.bjmodel = resultData.Result1;
                            setTimeout("goPage(1,10)", "1000")

                        }
                    });
                }
            },
            checkdata: function () {
                return true;
            },
            setBJQQ: function () {
                $.getJSON("/API/VIEWAPI.ashx?Action=Commanage_UPDATEQQ&r=" + Math.random(), { bj: model.nouser.bj, bjqq: $("#bjqq").val() }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        model.bjmodel.bjqq = $("#bjqq").val();
                        $("#myModal").modal('hide')
                    }
                });

            },
            savejbxx: function () {
                if (!model.nouser.now_smscode) {
                    alert("手机号不能为空");
                }
                if ($("#sfsmscode").attr("checked")) {
                    model.nouser.sfsmscode = "1"
                } else {
                    model.nouser.sfsmscode = ""
                }

                if ($("#sfemail").attr("checked")) {
                    model.nouser.sfemail = "1"
                } else {
                    model.nouser.sfemail = ""
                }

                if ($("#sfwx").attr("checked")) {
                    model.nouser.sfwx = "1"
                } else {
                    model.nouser.sfwx = ""
                }

                if ($("#sfqq").attr("checked")) {
                    model.nouser.sfqq = "1"
                } else {
                    model.nouser.sfqq = ""
                }

                if ($("#sfaddr").attr("checked")) {
                    model.nouser.sfaddr = "1"
                } else {
                    model.nouser.sfaddr = ""
                }
                model.nouser.now_province = $("#city").find(".prov").val();
                model.nouser.now_city = $("#city").find(".city").val();
                model.nouser.now_district = $("#city").find(".dist").val();
                $.post("/API/VIEWAPI.ashx?Action=Commanage_SAVEDATA&r=" + Math.random(), { data: JSON.stringify(model.nouser) }, function (resultData) {
                    if (JSON.parse(resultData).ErrorMsg == "") {
                        alert('操作成功')
                    }
                });
            },
            delgzjl: function (item) {
                $.post("/API/VIEWAPI.ashx?Action=Commanage_DELWORKJL&r=" + Math.random(), { workid: item.ID }, function (resultData) {
                    if (JSON.parse(resultData).ErrorMsg == "") {
                        model.workls.remove(item);
                        alert('操作成功')
                    }
                });

            },
            selnowwork: function (item) {
                item.ID = "0";
                model.nowwork = item;
                $("#city1").citySelect({
                    prov: model.nowwork.corp_province,
                    city: model.nowwork.corp_city,
                    dist: model.nowwork.corp_country,
                    nodata: "none"
                });
            },
            savegzjl: function () {
                model.nowwork.corp_province = $("#city1").find(".prov").val();
                model.nowwork.corp_city = $("#city1").find(".city").val();
                model.nowwork.corp_country = $("#city1").find(".dist").val();
                model.nowwork.xh = model.nouser.xh;
                model.nowwork.xm = model.nouser.xm;
                $.post("/API/VIEWAPI.ashx?Action=Commanage_SAVEWORKDATA&r=" + Math.random(), { data: JSON.stringify(model.nowwork) }, function (resultData) {
                    if (JSON.parse(resultData).ErrorMsg == "") {
                        model.workls.push(JSON.parse(resultData).Result)
                        alert('操作成功')
                    }
                });
            }

        })
        avalon.ready(function () {

            $.getJSON("/API/VIEWAPI.ashx?Action=Commanage_GETXSXX&r=" + Math.random(), { xh: getquery("xh") }, function (resultData) {
                if (resultData.ErrorMsg == "") {
                    model.nouser = resultData.Result
                    model.nouser.now_province = model.nouser.now_province ? model.nouser.now_province : "";
                    model.nouser.now_city = model.nouser.now_city ? model.nouser.now_city : "";
                    model.nouser.corp_country = model.nouser.corp_country ? model.nouser.corp_country : "";
                    model.nouser.now_addr = model.nouser.now_addr ? model.nouser.now_addr : "";

                    model.nouser.now_addr = model.nouser.now_province + model.nouser.now_city + model.nouser.corp_country + model.nouser.now_addr;


                }
            });


        })

        function getquery(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]); return null;
        }
    </script>
</head>
<body style="min-height: 700px">
    <div class="eyeview content list alumniReg" ms-controller="zhuce" style="min-height: 700px">
        <div class="listNav s_left1">

            <div>
                <div class="navTitle">
                    个人中心
                </div>

                <div>
                    <a>
                        <div class="navItem active" ms-click="changepage(1)">个人信息</div>
                    </a>

                </div>
            </div>

        </div>

        <div class="listContent zy-lico">
            <div class="regLeft" style="margin-top: 20px; width: 95%; overflow: auto">
                <div ms-if="pagecode=='1'">
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust"></span>学号：</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt" disabled="disabled" ms-duplex="nouser.xh" style="width: 238px" maxlength="50">
                            </div>
                        </div>
                    </div>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust"></span>姓名：</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt" disabled="disabled" ms-duplex="nouser.xm" style="width: 238px" maxlength="50">
                            </div>
                        </div>
                    </div>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust"></span>学院：</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt" disabled="disabled" ms-duplex="nouser.xbmc" style="width: 238px" maxlength="50">
                            </div>
                        </div>
                    </div>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust"></span>专业：</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt" disabled="disabled" ms-duplex="nouser.zymc" style="width: 238px" maxlength="50">
                            </div>
                        </div>
                    </div>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust"></span>班级：</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt" disabled="disabled" ms-duplex="nouser.bj" style="width: 238px" maxlength="50">
                            </div>
                        </div>
                    </div>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust"></span>手机号：</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt"  disabled="disabled"   ms-duplex="nouser.now_smscode" style="width: 238px" maxlength="50">
                            </div>
                        </div>
                    </div>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust"></span>邮箱：</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt"  disabled="disabled"  style="width: 238px" maxlength="50" ms-duplex="nouser.now_email">
                            </div>
                        </div>
                    </div>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust"></span>微信号：</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt"  disabled="disabled"  ms-duplex="nouser.now_wxid" style="width: 238px" maxlength="50">
                            </div>
                        </div>
                    </div>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust"></span>QQ号：</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt"  disabled="disabled"  ms-duplex="nouser.now_qq" style="width: 238px" maxlength="50">
                            </div>
                        </div>
                    </div>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust"> </span>具体地址：</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt"  disabled="disabled"  ms-duplex="nouser.now_addr" style="width: 238px" maxlength="50">
                            </div>
                        </div>
                    </div>

                </div>

                <div ms-if="pagecode=='2'">
                    <table class="table table-bordered table-condensed table-hover table-striped" style="margin-top: 20px">
                        <thead>
                            <tr>
                                <th style="text-align: center">公司名称</th>
                                <th style="text-align: center">职称</th>
                                <th style="text-align: center">起止时间</th>
                                <th style="text-align: center">年薪(万元)</th>
                                <th style="text-align: center">操作</th>

                            </tr>
                        </thead>
                        <tbody>
                            <tr ms-repeat-item="workls">
                                <td>{{item.corp_name}}</td>
                                <td>{{item.zc}}</td>
                                <td>{{item.begin_nf}}--{{item.end_nf}}</td>
                                <td>{{item.nx}}</td>
                                <td><a ms-click="selnowwork(item)" style="color: blue">选中</a><a style="color: red; margin-left: 10px" ms-click="delgzjl(item)"> 删除</a></td>
                            </tr>
                        </tbody>

                    </table>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust">* </span>地址：</div>
                        <div class="regField">
                            <div class="regField" id="city1">
                                <select class="prov regSel"></select>
                                <select class="city regSel" disabled="disabled"></select>
                                <select class="dist regSel" disabled="disabled"></select>
                            </div>
                            <div class="regFieldMsg">请填写你所在城市</div>
                        </div>
                    </div>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust">* </span>公司类型：</div>
                        <div class="regField">
                            <div class="regField" id="gszl">
                                <select class="prov regSel" ms-duplex="nowwork.corp_type">
                                    <option value="">请选择公司类型</option>

                                    <option>政府单位</option>
                                    <option>事业单位</option>
                                    <option>跨国企业</option>
                                    <option>国企</option>
                                    <option>大型民营企业</option>
                                    <option>中小型民营企业</option>
                                    <option>其它</option>
                                </select>
                            </div>
                            <div class="regFieldMsg">请选择公司类型</div>
                        </div>
                    </div>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust">* </span>公司名称：</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt" ms-duplex="nowwork.corp_name" style="width: 238px" maxlength="50">
                            </div>
                            <div class="regFieldMsg">请填写您的手机号</div>
                        </div>
                    </div>

                    <div class="regLine">
                        <div class="regLabel"><span class="regMust">* </span>岗位类别：</div>
                        <div class="regField">
                            <div class="regField">
                                <select id="gwlb" name="gwlb" class="regSel" style="width: 243px" ms-duplex="nowwork.gwlbdm">
                                    <option value="">请选择岗位类别</option>
                                    <option ms-repeat-el="gwdata" ms-attr-value="{{el.ID}}">{{el.gwlb}}</option>
                                </select>
                            </div>
                            <div class="regFieldMsg">请选择岗位</div>
                        </div>
                    </div>

                    <div class="regLine">
                        <div class="regLabel"><span class="regMust">* </span>职称：</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt" ms-duplex="nowwork.zc" style="width: 238px" maxlength="50">
                            </div>
                        </div>
                    </div>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust">* </span>年薪：(万元)</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt" ms-duplex="nowwork.nx" style="width: 238px" maxlength="50">
                            </div>
                        </div>
                    </div>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust">* </span>开始年份：</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt ny" ms-duplex="nowwork.begin_nf" style="width: 238px" maxlength="50">
                            </div>
                        </div>
                    </div>
                    <div class="regLine">
                        <div class="regLabel"><span class="regMust">* </span>结束年份：</div>
                        <div class="regField">
                            <div class="regField">
                                <input type="text" class="regTxt ny" ms-duplex="nowwork.end_nf" style="width: 238px" maxlength="50">
                            </div>
                        </div>
                    </div>

                    <div>
                        <a href="javascript:void(0)" class="baocun" style="" ms-click="savegzjl()">新增工作经历</a>
                    </div>
                </div>
                <div ms-if="pagecode=='3'">
                </div>
                <div ms-if="pagecode=='4'">
                    <p>系部名称:{{bjxsdata[0].xbmc}},专业:{{bjxsdata[0].zymc}} </p>
                    <p>班级QQ群：<span>{{bjmodel.bjqq}}</span> <a style="color: blue" data-toggle="modal" data-target="#myModal">设置班级QQ群号码</a></p>
                    <table class="table table-bordered  table-hover table-striped" style="margin-top: 20px">
                        <thead>
                            <tr>
                                <th style="text-align: center">学号</th>
                                <th style="text-align: center">姓名</th>

                                <th style="text-align: center">班级</th>
                                <th style="text-align: center">是否注册</th>

                                <th style="text-align: center">操作</th>


                            </tr>
                        </thead>
                        <tbody id="tabFY">
                            <tr ms-repeat-item="bjxsdata">
                                <td>{{item.xh}}</td>
                                <td>{{item.xm}}</td>
                                <td>{{item.bj}}</td>
                                <td>{{item.sfzc=='1'?"是":"否"}}</td>

                                <td><a ms-attr-href="userinfo.html?id={{item.xh}}" target="_blank" style="color: blue">查看详细</a></td>
                            </tr>
                        </tbody>

                    </table>
                    <table width="60%" align="right">
                        <tr>
                            <td>
                                <div id="barcon" name="barcon"></div>
                            </td>
                        </tr>
                    </table>

                    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                        &times;
                                    </button>
                                    <h4 class="modal-title" id="myModalLabel">设置班级QQ群号码
                                    </h4>
                                </div>
                                <div class="modal-body">
                                    <form class="form-inline" role="form">
                                        <div class="form-group">
                                            <label class="sr-only" for="bjqq">QQ群号</label>
                                            <input type="text" class="form-control" id="bjqq" placeholder="QQ群号">
                                        </div>

                                    </form>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">
                                        关闭
                                    </button>
                                    <button type="button" class="btn btn-primary" ms-click="setBJQQ()">
                                        提交更改
                                    </button>
                                </div>
                            </div>
                            <!-- /.modal-content -->
                        </div>
                        <!-- /.modal -->
                    </div>
                    <script>
                        function goPage(pno, psize) {
                            var itable = document.getElementById("tabFY");
                            var num = itable.rows.length;//表格所有行数(所有记录数)
                            console.log(num);
                            var totalPage = 0;//总页数
                            var pageSize = psize;//每页显示行数
                            //总共分几页 
                            if (num / pageSize > parseInt(num / pageSize)) {
                                totalPage = parseInt(num / pageSize) + 1;
                            } else {
                                totalPage = parseInt(num / pageSize);
                            }
                            var currentPage = pno;//当前页数
                            var startRow = (currentPage - 1) * pageSize + 1;//开始显示的行  31 
                            var endRow = currentPage * pageSize;//结束显示的行   40
                            endRow = (endRow > num) ? num : endRow; 40
                            console.log(endRow);
                            //遍历显示数据实现分页
                            for (var i = 1; i < (num + 1) ; i++) {
                                var irow = itable.rows[i - 1];
                                if (i >= startRow && i <= endRow) {
                                    irow.style.display = "table-row";
                                } else {
                                    irow.style.display = "none";
                                }
                            }
                            var pageEnd = document.getElementById("pageEnd");
                            var tempStr = "共" + num + "条记录 分" + totalPage + "页 当前第" + currentPage + "页";
                            if (currentPage > 1) {
                                tempStr += "<a href=\"#\" onClick=\"goPage(" + (1) + "," + psize + ")\">首页</a>";
                                tempStr += "<a href=\"#\" onClick=\"goPage(" + (currentPage - 1) + "," + psize + ")\"><上一页</a>"
                            } else {
                                tempStr += "首页";
                                tempStr += "<上一页";
                            }

                            if (currentPage < totalPage) {
                                tempStr += "<a href=\"#\" onClick=\"goPage(" + (currentPage + 1) + "," + psize + ")\">下一页></a>";
                                tempStr += "<a href=\"#\" onClick=\"goPage(" + (totalPage) + "," + psize + ")\">尾页</a>";
                            } else {
                                tempStr += "下一页>";
                                tempStr += "尾页";
                            }

                            document.getElementById("barcon").innerHTML = tempStr;

                        }
                    </script>
                </div>
            </div>
            <div class="cl"></div>

        </div>
    </div>
</body>
</html>
